function getServerHost() {
  var host1 = "http://wkfw.unisk.cn";
  var host2 = "http://10.122.202.136:18083";
  return host1;
  // return host2;
}
window.alert = function(name) {
  var iframe = document.createElement("IFRAME");
  iframe.style.display = "none";
  iframe.setAttribute("src", 'data:text/plain,');
  document.documentElement.appendChild(iframe);
  window.frames[0].window.alert(name);
  iframe.parentNode.removeChild(iframe);
};

function preventMove() {
  document.addEventListener("touchmove", function(a) {
    a.preventDefault()
  }, false)
};

function GetRequest() {
  var e = location.search;
  var f = {};
  if (e.indexOf("?") != -1) {
    var g = e.substr(1);
    g = g.split("&");
    for (var h = 0; h < g.length; h++) {
      f[g[h].split("=")[0]] = decodeURIComponent(g[h].split("=")[1]);
    }
  }
  return f;
}

function judgePhone(){
  var u = navigator.userAgent;
  if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) { //安卓手机
  return {
    type:'Android',
    val:0
  }
    // window.location.href = "mobile/index.html";
  } else if (u.indexOf('iPhone') > -1) { //苹果手机
    // window.location.href = "mobile/index.html";
    return {
      type:'ios',
      val:1
    }
  } else if (u.indexOf('Windows Phone') > -1) { //winphone手机
    return {
      type:'wPhone',
      val:2
    }
    // window.location.href = "mobile/index.html";
  }
}
//横屏无效
window.addEventListener("orientationchange", function() {
  if (0 !== window.orientation) {
    alert('请竖屏浏览');
  } else {}
}, false);

function checkMobile(str) { //写一个判断函数
  var re = /^1\d{10}$/ //正则表达式
  if (re.test(str)) { //判断字符是否是11位数字
    return true;
  } else {
    return false;
  }
}
//引入animate.css
function closeBar(btnele, parentele) {
  $(btnele).click(function() {
    $(parentele).addClass('slideOutUp').removeClass('slideInDown');
  });
}

function showBar(btnele, parentele) {
  $(btnele).click(function() {
    $(parentele).addClass('slideInDown').removeClass('slideOutUp none');
  });
  $(btnele).off('click');
}

function autoshowBar(parentele) {
  $(parentele).addClass('slideInDown').removeClass('slideOutUp none');

}

function autocloseBar(parentele) {
  $(parentele).addClass('slideOutUp ').removeClass('slideInDown');
}
